<%@include file="/init.jsp" %>
<%@page import="com.caresms.service.Country_MasterLocalServiceUtil"%>
<%@page import="com.caresms.service.City_MasterLocalServiceUtil"%>
<%@page import="com.caresms.model.Country_Master"%>
<%@page import="com.caresms.model.City_Master"%>
<portlet:actionURL name="cityURL" var="cityURL">
</portlet:actionURL>
<%
List<Country_Master> cl=Country_MasterLocalServiceUtil.getCountry_Masters(-1,-1);
List<City_Master> cityL=City_MasterLocalServiceUtil.getCity_Masters(-1,-1);

%>
<aui:form name="CityMaster" method="post" action="<%=cityURL.toString() %>">
<aui:select name="countryname">
<%for(Country_Master c:cl)
	{%>
<aui:option value="<%=c.getCountryId() %>"><%=c.getCountryName() %></aui:option>
<%} %>
</aui:select>
<aui:input name="city" type="textbox" label="City" id="city">
<aui:validator name="required" errorMessage="this field is requred"></aui:validator>
<aui:validator name="max">
'20'
</aui:validator>
<aui:validator name="alphanum"></aui:validator>
</aui:input>
<aui:button type="submit" value="ADD" cssClass="submitbtn"></aui:button>
</aui:form>

<liferay-ui:search-container delta="10" emptyResultsMessage="No Results Found">
<liferay-ui:search-container-results total="<%=cityL.size() %>" results="<%=cityL%>" />
<liferay-ui:search-container-row modelVar="city" className="com.caresms.model.impl.City_MasterImpl">
<liferay-ui:search-container-column-text name='City Name' value="<%=city.getCityName() %>" href="" />
<%
 Country_Master singlec=Country_MasterLocalServiceUtil.getCountry_Master(city.getCountryId());
%>
<liferay-ui:search-container-column-text name='Country Name' value="<%=singlec.getCountryName() %>" href="" />
<liferay-ui:search-container-column-jsp path="/CityMaster/buttoncity.jsp" />
</liferay-ui:search-container-row>
<liferay-ui:search-iterator searchContainer="<%= searchContainer %>" paginate="<%= true %>" />

</liferay-ui:search-container>